package com.chen.springboot.controller;

import com.chen.springboot.Service.ScheduleService;
import com.chen.springboot.mapper.ScheduleMapper;
import com.chen.springboot.pojo.Schedule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/schdule")
public class EmployeesContr {

    @Autowired
    private ScheduleService scheduleService;
    @RequestMapping("/emps")
    public String list(Model model){
        List<Schedule> schedules = scheduleService.querySchedule();
        model.addAttribute("lists",schedules);
        return "list";
    }
    @RequestMapping("/test")
    public List<Schedule> test(){
        List<Schedule> schedules = scheduleService.querySchedule();
        System.out.println(schedules);
        return schedules;
    }
}
